package com.shanshi.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.webkit.WebSettings;
import android.webkit.WebView;

public class GaoDeActivity extends Activity {
    private WebView web_gaode;
    private String start,end,mode;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_gao_de);
        Intent intent = getIntent();
        start = intent.getStringExtra("start");
        end = intent.getStringExtra("end");
        mode = intent.getStringExtra("mode");
        web_gaode= (WebView) findViewById(R.id.web_gaode);
        String url="http://uri.amap.com/navigation?from="+start+",startpoint&to="+end+",endpoint&via=?&mode="+mode+"&policy=1&src=mypage&coordinate=gaode&callnative=0";
        Log.e("web", "onCreate: "+url );
        String url2="http://uri.amap.com/navigation?from=116.478346,39.997361,startpoint&to=116.3246,39.966577,endpoint&via=116.402796,39.936915&mode=car&policy=1&src=mypage&coordinate=gaode&callnative=0";

        String url3="http://uri.amap.com/marker?position="+start+"&name=首开广场&src=mypage&coordinate=gaode&callnative=0";
        web_gaode.loadUrl(url);
        WebSettings webSettings=web_gaode.getSettings();
        webSettings.setJavaScriptEnabled(true);
//        web_gaode.setWebViewClient(new WebViewClient(){
//            @Override
//            public boolean shouldOverrideUrlLoading(WebView view, String url) {
//                // TODO Auto-generated method stub
//                //返回值是true的时候控制去WebView打开，为false调用系统浏览器或第三方浏览器
//                //view.loadUrl(url);
//
//                return false;
//            }
//        });
    }

}
